<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.ld.com/shield/tags" prefix="shield"%>
<%@ taglib uri="http://www.ld.com/jsp/plugin" prefix="plugin"%>
<%@ page trimDirectiveWhitespaces="true"%>
<fmt:setLocale value="zh_CN" />
<shield:permssion type="button">
	<form action="${ctxPathA}/usercenter/user_countdown/addOrUpdate" method="post"
		autocomplete="off" class="show-info">
		<shield:token />
		<input id="id" name="id" type="hidden" maxlength="100"
			value="${model.id }">
		<table class="tab-show">
			<colgroup>
				<col width="20%">
				<col width="">
			</colgroup>
			<tr>
				<th><label><font color="red">*</font>名称：</label></th>
				<td><input type="text" name="title" class=""
					value="${model.title}"></td>
			</tr>
			<tr>
				<th><label><font color="red">*</font>截至日期：</label></th>
				<td><input type="text" name="endTime" value="${model.endTime}"
					class="Wdate "></td>
			</tr>
			<tr>
				<th><label>背景颜色：</label></th>
				<td>
					<div >
					<c:forEach var="i" begin="0" end="16">
					<c:choose>
						<c:when test="${i eq 0 }">
						<a class="PickColor ${model.backgroundColor eq i or empty model.backgroundColor ? "PickColorActive" : "" } "  data-index="${i}"><span class="color_style_${i}"></span></a>
						</c:when>
						<c:otherwise>
							<a class="PickColor ${model.backgroundColor eq i ? "PickColorActive" : "" }"  data-index="${i}"><span class="color_style_${i}"></span></a>
						</c:otherwise>
					</c:choose>
					</c:forEach>
					</div>
					<br>
					<div class="red mt5">(可自定义背景颜色,3天内自动变成橙色,1天内自动变成红色,自定义倒计时过期后自动变成灰色)</div> 
					<input type="hidden" id="backgroundColor"  name="backgroundColor"  value="${empty model.backgroundColor ? 0 : model.backgroundColor}" />
				</td>
			</tr>
			<tr>
				<th><label>序号：</label></th>
				<td><input type="text" name="xh" class="number" value="${model.xh}"></td>
			</tr>
		</table>
		<div class="taCenter">
			<input class="button" type="submit" value="提交" /> <input
				class="button default" type="reset" value="重置" />
		</div>
	</form>
</shield:permssion>
<script type="text/javascript">
$(function(){
	$(".PickColor").click(function(){
		$(".PickColor").removeClass("PickColorActive");
		$(this).addClass("PickColorActive");
		$("#backgroundColor").val($(this).data("index"));
	});
	
})

</script>